package com.example.smartclassroom.controller;

import com.example.smartclassroom.entity.Teacher;
import com.example.smartclassroom.model.MyResponseData;
import com.example.smartclassroom.service.TeacherService;
import com.example.smartclassroom.service.impl.TeacherSeiveceImpl;
import com.example.smartclassroom.util.JsonDate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("teacher/")
public class TeacherController {

    @Autowired
    private TeacherService teacherService;

    /**
     * 编辑老师信息
     * @param teacher
     * @return
     */
    @RequestMapping("edit")
    public JsonDate edit(Teacher teacher) {
        return teacherService.update(teacher);
    }

    /**
     * 查询所有老师姓名
     */
    @RequestMapping("queryAllTeacherName")
    public JsonDate queryAllTeacherName() {
        return teacherService.queryAllTeacherName();
    }
}
